<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVCarSitesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('v_car_sites', function (Blueprint $table) {
            $table->increments('id');
            $table->string('site_key',32)->default('')->comment('配置项标识');
            $table->string('site_value',512)->default('')->comment('配置项值');
            $table->tinyInteger('site_type')->default(0)->comment('配置类型，1车型，2车厢，3车长');
            $table->integer('site_status')->default(1)->comment('配置状态，1可用-1禁用');
            $table->timestamps();
            $table->index('site_type', 'idx_site_type');
            $table->index('site_status', 'idx_site_status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('v_car_sites');
    }
}
